window.onload = initalizePage;
window.onunload = function() {}

function initalizePage() {
	var vpslinks = document.getElementById('vpses').getElementsByTagName('a');
	var vpslinkslen = vpslinks.length;
	
	for (var i = 0; i < vpslinkslen; i++) {
		vpslinks[i].onmouseover = updatevpl;
	}

	var rightCol = document.getElementById('rightCol');
	var infodiv = document.createElement('div');
	infodiv.id = 'infodiv';
	infodiv.innerHTML = document.getElementById('specks').innerHTML;
	rightCol.appendChild(infodiv);

	var infolinks = rightCol.getElementsByTagName('a');	
	var infolinkslen = infolinks.length;
	
	for (var i = 0; i < infolinkslen; i++) {
		infolinks[i].onclick = updateinfodiv;
	}

}

function updatevpl() {
	var vplLink = document.getElementById('vplImageLink');
	vplLink.href = this.href;
	var img = vplLink.getElementsByTagName('img')[0];
	img.src = '/24/only_2_m/images/vpl/' + this.hash.substring(1) + '.jpg';
	return false;
}

function updateinfodiv() {
	var infodiv = document.getElementById('infodiv');
	//document.write('hello');
// checking and trying to get node instead of #text white space
// 	while (tr2 && tr2.nodeType != 1) {
// 		tr2 = tr2.previousSibling;
// 	}
	infodiv.innerHTML = this.parentNode.nextSibling.nextSibling.innerHTML;
	return false;
}